unit GameContentUnit;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, Grids, DBGrids, StdCtrls, Buttons, DB, ADODB;

type
  TfrmGameContent = class(TForm)
    DBGrid1: TDBGrid;
    btnAdd: TBitBtn;
    btnEdit: TBitBtn;
    btnDel: TBitBtn;
    btnOK: TBitBtn;
    btnCancel: TBitBtn;
    Query: TADOQuery;
    QueryBrand: TADOQuery;
    QueryBrandBrandId: TAutoIncField;
    QueryBrandBrandName: TStringField;
    QueryGameContentId: TIntegerField;
    QueryGameContentName: TStringField;
    QueryGameContentUrl: TStringField;
    QueryBrandId: TIntegerField;
    QueryBrandName: TStringField;
    DataSource1: TDataSource;
    btnAddGroup: TButton;
    procedure FormCreate(Sender: TObject);
    procedure btnCancelClick(Sender: TObject);
    procedure btnAddClick(Sender: TObject);
    procedure btnEditClick(Sender: TObject);
    procedure btnDelClick(Sender: TObject);
    procedure btnAddGroupClick(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  frmGameContent: TfrmGameContent;

implementation

uses FunctionUnit, GTMain, GameContentGroupUnit;

{$R *.dfm}

procedure TfrmGameContent.FormCreate(Sender: TObject);
begin
  OpenDataSet('SELECT * FROM Brand', QueryBrand, Database);
  OpenDataSet('SELECT * FROM GameContent', Query, Database);

end;

procedure TfrmGameContent.btnCancelClick(Sender: TObject);
begin
  Close;
end;

procedure TfrmGameContent.btnAddClick(Sender: TObject);
begin
  Query.Append;
end;

procedure TfrmGameContent.btnEditClick(Sender: TObject);
begin
  Query.Edit;
end;

procedure TfrmGameContent.btnDelClick(Sender: TObject);
begin
  Query.Delete;
end;

procedure TfrmGameContent.btnAddGroupClick(Sender: TObject);
begin
  with TfrmGameContentGroup.Create(Application) do
  try
    ShowModal;
  finally
    Free;
  end;

end;

end.
